﻿{template 'header',$module}
{load('profile.js')}
{if $is_company && !$_edittime}
	<div class="warn">The Company has not been perfect details! Comprehensive business information helps to get the trust of others, make potential business partners, access to business opportunities, please complete as soon as possible</div>
{/if}
{if isset($success)}
	<div class="ok">Data saved successfully, you can：<a href="edit.php" class="t">Continue to improve</a> &nbsp;|&nbsp; <a href="{$DT[file_my]}" class="t">Ads</a> &nbsp;|&nbsp; <a href="./" class="t">Back to Business Room Home</a></div>
{/if}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="Tab0"><a href="javascript:Tab(0);"><span>Personal Information</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="Tab1"><a href="javascript:Tab(1);"><span>Password Management</span></a></td>
{if $is_company}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="Tab2"><a href="javascript:Tab(2);"><span>Corporate Information</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="Tab3"><a href="javascript:Tab(3);"><span>Company Contacts</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="Tab4"><a href="javascript:Tab(4);"><span>About</span></a></td>
{/if}
</tr>
</table>
</div>
<form method="post" action="edit.php" onsubmit="return Dcheck();" id="dform">
<input type="hidden" name="tab" id="tab" value="{$tab}"/>
<table cellpadding="6" cellspacing="1" class="tb">
<tbody id="Tabs0" style="display:;">
<tr>
<td class="tl">Username</td>
<td class="tr f_b">{$_username}</td>
</tr>
<tr>
<td class="tl">Email</td>
<td class="tr">{$_email}{if $vemail}&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/v_email.gif" title="Certified" align="absmiddle"/>{/if}{if $DT[mail_type] != 'close'}&nbsp;&nbsp;<a href="send.php?action=email" class="t">[Modification]</a>{/if}</td>
</tr>
{if $vtruename}
<tr>
<td class="tl"><span class="f_red">*</span>Real Name</td>
<td class="tr"><input type="hidden" name="post[truename]" id="truename" value="{$truename}"/>{$truename}&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/v_truename.gif" title="Certified" align="absmiddle"/></td>
</tr>
{else}
<tr>
<td class="tl"><span class="f_red">*</span>Real Name</td>
<td class="tr"><input type="text" size="10" name="post[truename]" id="truename" value="{$truename}"/>&nbsp;<span id="dtruename" class="f_red"></span></td>
</tr>
{/if}
<tr>
<td class="tl"><span class="f_red">*</span>Gender</td>
<td class="tr">
<input type="radio" name="post[gender]" value="1" {if $gender==1}checked="checked"{/if}/> Mr.
<input type="radio" name="post[gender]" value="2" {if $gender==2}checked="checked"{/if}/> Ms.
</td>
</tr>
{if !$is_company}
<tr>
<td class="tl"><span class="f_red">*</span>Area</td>
<td class="tr">{ajax_area_select('post[areaid]', 'Please select', $areaid)}&nbsp;<span id="dareaid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Address</td>
<td class="tr"><input type="text" size="40" name="post[address]" id="daddress" value="{$address}"/>&nbsp;<span id="ddaddress" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Zip code</td>
<td class="tr"><input type="text" size="8" name="post[postcode]" id="postalcode" value="{$postcode}"/></td>
</tr>
<tr>
<td class="tl">Contact</td>
<td class="tr"><input type="text" size="20" name="post[telephone]" id="telephone" value="{$telephone}"/>&nbsp;<span id="dtelephone" class="f_red"></span></td>
</tr>
{/if}
{if $vmobile}
<tr>
<td class="tl">Cell Phone Number</td>
<td class="tr"><input type="hidden" name="post[mobile]" id="mobile" value="{$mobile}"/>{$mobile}&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/v_mobile.gif" title="Certified" align="absmiddle"/>{if $DT[sms]}&nbsp;&nbsp;<a href="send.php?action=mobile" class="t">[Modification]</a>{/if}</td>
</tr>
{else}
<tr>
<td class="tl">Cell Phone Number</td>
<td class="tr"><input type="text" size="20" name="post[mobile]" id="mobile" value="{$mobile}"/></td>
</tr>
{/if}
<tr>
<td class="tl">Department</td>
<td class="tr"><input type="text" size="20" name="post[department]" id="department" value="{$department}"/></td>
</tr>
<tr>
<td class="tl">Post</td>
<td class="tr"><input type="text" size="20" name="post[career]" id="career" value="{$career}"/></td>
</tr>
{if $DT[im_qq]}
<tr>
<td class="tl">QQ</td>
<td class="tr"><input type="text" size="20" name="post[qq]" id="qq" value="{$qq}"/></td>
</tr>
{/if}
{if $DT[im_ali]}
<tr>
<td class="tl">Ali</td>
<td class="tr"><input type="text" size="20" name="post[ali]" id="ali" value="{$ali}"/></td>
</tr>
{/if}
{if $DT[im_msn]}
<tr>
<td class="tl">MSN</td>
<td class="tr"><input type="text" size="30" name="post[msn]" id="msn" value="{$msn}"/></td>
</tr>
{/if}
{if $DT[im_skype]}
<tr>
<td class="tl">Skype</td>
<td class="tr"><input type="text" size="20" name="post[skype]" id="skype" value="{$skype}"/></td>
</tr>
{/if}
<tr>
<td class="tl">Station Letters tone</td>
<td class="tr">
<div id="audition"></div>
<input type="radio" name="post[sound]" value="0" {if $sound==0}checked="checked"{/if} id="sound_0"/><label for="sound_0"> No</label>&nbsp;&nbsp;
<input type="radio" name="post[sound]" value="1" {if $sound==1}checked="checked"{/if} id="sound_1"/> <a href="javascript:Inner('audition', sound('message_1'));Dd('sound_1').checked=true;void(0);" title="Click to listen">Beep1</a>&nbsp;&nbsp;
<input type="radio" name="post[sound]" value="2" {if $sound==2}checked="checked"{/if} id="sound_2"/> <a href="javascript:Inner('audition', sound('message_2'));Dd('sound_2').checked=true;void(0);" title="Click to listen">Beep2</a>&nbsp;&nbsp;
<input type="radio" name="post[sound]" value="3" {if $sound==3}checked="checked"{/if} id="sound_3"/> <a href="javascript:Inner('audition', sound('message_3'));Dd('sound_3').checked=true;void(0);" title="Click to listen">Beep3</a>&nbsp;&nbsp;
</td>
</tr>
{if $MFD}{fields_html('<td class="tl">', '<td class="tr">', $user, $MFD)}{/if}
</tbody>
<tbody id="Tabs1" style="display:none;">
<tr>
<td class="tl">New Password</td>
<td class="tr"><input type="password" size="20" name="post[password]" id="password" onblur="validator('password');" autocomplete="off"/>&nbsp;<span class="f_gray">If you do not change your password, please leave blank</span> <span id="dpassword" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Repeat new password</td>
<td class="tr"><input type="password" size="20" name="post[cpassword]" id="cpassword" autocomplete="off"/>&nbsp;<span id="dcpassword" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Existing password</td>
<td class="tr f_red"><input type="password" size="20" name="post[oldpassword]" id="oldpassword" autocomplete="off"/>&nbsp; To change your password, enter your existing password required <span id="doldpassword" class="f_red"></span></td>
</tr>

<tr>
<td class="tl">New payment password</td>
<td class="tr"><input type="password" size="20" name="post[payword]" id="payword" onblur="validator('payword');" autocomplete="off"/>&nbsp;<span class="f_gray">If you do not change the payment password, please leave blank</span> <span id="dpayword" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Repeat the new payment password</td>
<td class="tr"><input type="password" size="20" name="post[cpayword]" id="cpayword" autocomplete="off"/>&nbsp;<span id="dcpayword" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Existing payment password</td>
<td class="tr f_red"><input type="password" size="20" name="post[oldpayword]" id="oldpayword" autocomplete="off"/>&nbsp; The default password is set to pay the same password and registration&nbsp;&nbsp;<a href="send.php?action=payword"  class="t">Forget payment password</a><span id="doldpayword" class="f_red"></span></td>
</tr>

</tbody>
{if $is_company}
<tbody id="Tabs2" style="display:none;">
<tr>
<td class="tl">Company name</td>
<td class="tr f_b">{$_company}</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span>Type of company</td>
<td class="tr">{dselect($COM_TYPE, 'post[type]', 'Please select', $type, 'id="type"', 0)}&nbsp;<span id="dtype" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Image Image</td>
<td class="tr"><input name="post[thumb]" type="text" size="60" id="thumb" value="{$thumb}" readonly/>&nbsp;&nbsp;<span onclick="Dthumb({$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb').value, true);" class="jt">[Upload]</span>&nbsp;&nbsp;<span onclick="_preview(Dd('thumb').value);" class="jt">[Preview]</span>&nbsp;&nbsp;<span onclick="Dd('thumb').value='';" class="jt">[Delete]</span><br/>
<span class="f_gray">Recommend using LOGO, office environment, iconic images, the optimal size for the{$MOD[thumb_width]}px*{$MOD[thumb_height]}px</span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span>Area</td>
<td class="tr">{ajax_area_select('post[areaid]', 'Please select', $areaid)}&nbsp;<span id="dareaid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span>Industry</td>
<td class="tr">
<div id="catesch"></div><div id="cate">{ajax_category_select('', '', 0, 4, 'size="2" style="height:80px;width:160px;"')}</div>
<input type="button" value=" Add↓ " class="btn" onclick="addcate({$MOD[cate_max]});"/>
<input type="button" value=" ×Delete " class="btn" onclick="delcate();"/>
{if $DT[schcate_limit]}<input type="button" value=" Search " class="btn" onclick="schcate(4);"/>{/if}
&nbsp;You can add up <strong class="f_red">{$MOD[cate_max]}</strong> An Industry
<br/><select name="cates" id="cates" size="2" style="height:100px;width:380px;margin-top:5px;">
{loop $cates $c}
<option value="{$c}">{strip_tags(cat_pos(get_cat($c), '/'))}</option>
{/loop}
</select>
<input type="hidden" name="post[catid]" value="{$catid}" id="catid"/><br/>
<span id="dcatid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span>The main business scope</td>
<td class="tr"><input type="text" size="80" name="post[business]" id="business" value="{$business}" maxlength="250"/>&nbsp;<span id="dbusiness" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span>Year Founded</td>
<td class="tr"><input type="text" size="15" name="post[regyear]" id="regyear" value="{$regyear}" maxlength="4"/>&nbsp;<span id="dregyear" class="f_red"></span> <span class="f_gray">(Years，As：2004)</span></td>
</tr>
<tr>
<td class="tl">Business</td>
<td class="tr">
<span id="com_mode">{$mode_check}</span> <span class="f_gray">(Choose up{$MOD[mode_max]}Seed)</span></td>
</tr>
<tr>
<td class="tl">Company Size</td>
<td class="tr">{dselect($COM_SIZE, 'post[size]', 'Please select the size', $size, '', 0)}</td>
</tr>
<tr>
<td class="tl">Registered Capital</td>
<td class="tr">{dselect($MONEY_UNIT, 'post[regunit]', '', $regunit, '', 0)} <input type="text" size="6" name="post[capital]" id="capital" value="{$capital}"/> 万</td>
</tr>
<tr>
<td class="tl">Sales of products<br/>(Services)</td>
<td class="tr"><input type="text" size="50" name="post[sell]" id="sell" value="{$sell}" maxlength="200"/> <span class="f_gray">Multiple products or services, please use the '|' numbers separated</span></td>
</tr>
<tr>
<td class="tl">Procurement of products<br/>(Required service)</td>
<td class="tr"><input type="text" size="50" name="post[buy]" id="buy" value="{$buy}" maxlength="200"/> <span class="f_gray">Multiple products or services, please use the '|' numbers separated</span></td>
</tr>
{if $CFD}{fields_html('<td class="tl">', '<td class="tr">', $user, $CFD)}{/if}
</tbody>
<tbody id="Tabs3" style="display:none;">

<tr>
<td class="tl"><span class="f_red">*</span>Address</td>
<td class="tr"><input type="text" size="60" name="post[address]" id="daddress" value="{$address}" maxlength="200"/>&nbsp;<span id="ddaddress" class="f_red"></span></td>
</tr>

<tr>
<td class="tl">Zip code</td>
<td class="tr"><input type="text" size="8" name="post[postcode]" id="postalcode" value="{$postcode}"/></td>
</tr>

<tr>
<td class="tl"><span class="f_red">*</span>Phone</td>
<td class="tr"><input type="text" size="20" name="post[telephone]" id="telephone" value="{$telephone}"/>&nbsp;<span id="dtelephone" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">Fax</td>
<td class="tr"><input type="text" size="20" name="post[fax]" id="fax" value="{$fax}"/></td>
</tr>
<tr>
<td class="tl">CompanyEmail</td>
<td class="tr"><input type="text" size="30" name="post[mail]" id="mail" value="{$mail}"/> <span class="f_gray">[Public]</span></td>
</tr>
<tr>
<td class="tl">Company Website</td>
<td class="tr"><input type="text" size="30" name="post[homepage]" id="homepage" value="{$homepage}"/></td>
</tr>
</tbody>
<tbody id="Tabs4" style="display:none;">
<tr>
<td class="tl"><span class="f_red">*</span>About</td>
<td class="tr"><textarea name="post[introduce]" id="introduce" class="dsn">{$introduce}</textarea>
{deditor($moduleid, 'introduce', $group_editor, '95%', 300)}<br/><span id="dintroduce" class="f_red"></span></td>
</tr>
</tbody>
{/if}
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="30"><input type="submit" name="submit" value=" Save " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" Back " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
<script type="text/javascript">
var vid = '';
function validator(id) {
	if(!Dd(id).value) return false;
	vid = id;
	makeRequest('moduleid={$moduleid}&action=member&job='+id+'&value='+Dd(id).value+'&userid={$userid}', AJPath, '_validator');
}
function _validator() {
	if(xmlHttp.readyState==4 && xmlHttp.status==200) {
		Dd('d'+vid).innerHTML = xmlHttp.responseText ? xmlHttp.responseText : '';
	}
}
function Dcheck() {
	if(Dd('truename').value == '') {
		Tab(0);
		Dmsg('Please fill out the real name', 'truename');
		return false;
	}
	if(Dd('password').value != '') {
		if(Dd('cpassword').value == '') {
			Tab(1);
			Dmsg('Please re-enter the password', 'cpassword');
			return false;
		}
		if(Dd('password').value != Dd('cpassword').value) {
			Tab(1);
			Dmsg('The two passwords do not match', 'password');
			return false;
		}
		if(Dd('oldpassword').value == '') {
			Tab(1);
			Dmsg('Please enter a password', 'oldpassword');
			return false;
		}
	}
	if(Dd('payword').value != '') {
		if(Dd('cpayword').value == '') {
			Tab(1);
			Dmsg('Please re-enter payment password', 'cpayword');
			return false;
		}
		if(Dd('payword').value != Dd('cpayword').value) {
			Tab(1);
			Dmsg('Enter the password twice inconsistent payment', 'payword');
			return false;
		}
		if(Dd('oldpayword').value == '') {
			Tab(1);
			Dmsg('Please enter payment password', 'oldpayword');
			return false;
		}
	}

{if !$is_company}	
	if(Dd('areaid_1').value == 0) {
		Tab(0);
		Dmsg('Please select the location', 'areaid');
		return false;
	}
{/if}

	{if $MFD}{fields_js($MFD)}{/if}
	{if $is_company}
	{if $CFD}{fields_js($CFD)}{/if}
	if(Dd('type').value == '') {
		Tab(2);
		Dmsg('Select by company type', 'type');
		return false;
	}
	if(Dd('areaid_1').value == 0) {
		Tab(2);
		Dmsg('Please select the company is located', 'areaid');
		return false;
	}
	if(Dd('catid').value.length < 2) {
		Tab(2);
		Dmsg('Please Select Company Industry', 'catid');
		return false;
	}
	if(Dd('business').value.length < 10) {
		Tab(2);
		Dmsg('The main business scope at least 10 characters', 'business');
		return false;
	}
	if(Dd('regyear').value.length < 4) {
		Tab(2);
		Dmsg('Please fill in company Year established', 'regyear');
		return false;
	}
	if(Dd('daddress').value.length < 5) {
		Tab(3);
		Dmsg('Please fill in company address', 'daddress');
		return false;
	}
	if(Dd('telephone').value.length < 6) {
		Tab(3);
		Dmsg('Please fill in company phone', 'telephone');
		return false;
	}
	if(FCKLen('introduce') < 10) {
		Tab(4);
		Dmsg('Company not less than 10 words, the current has been entered '+ FCKLen (' introduce ') +' word', 'introduce');
		return false;
	}
	{/if}
	return true;
}
</script>
<script type="text/javascript">
s('edit');
{if $tab}
Tab({$tab});
{else}
m('Tab0');
{/if}
</script>
{template 'footer',$module}